use "data\influenza_allocation_level.dta",replace

foreach var of varlist log_pop11_district dr_pre10 log_realincome10 log_area11_district share_whites11_district town_n share_urban11_district share_industry_employed11 share_indist11_district share_pop2040  share_bombay11_district log_bombay_district log_dist_madras log_dist_calcutta closest_port sum_junction mean_rr ww1_deaths_share hq_lat hq_lon hq_elevation log_rain_cum_normal rain_cum_dev17 rain_cum_dev    share_hindu_district share_muslim_district     {

mean `var' if indian_dm==0
reg `var' indian_dm, robust
sum `e(depvar)' if e(sample)
outreg2 using "output\table1_`var'",  $outreg_settings  adds(Mean of dep. var, `r(mean)')  replace
reg `var' indian_dm if mean_indian_dm!=0, vce(cluster did) 
sum `e(depvar)' if e(sample)
outreg2 using "output\table1_`var'",  $outreg_settings  adds(Mean of dep. var, `r(mean)')  
}

